package itheima.com.exam.zy2;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class Test {
//    计算现在距离今年大年初一（2026年2月17日0点0分0秒）还有多少天，多少小时，多少分钟，多少秒？
public static void main(String[] args) {
    LocalDateTime now = LocalDateTime.now();
    LocalDateTime target = LocalDateTime.of(2026, 2, 17, 0, 0, 0);
    long days = ChronoUnit.DAYS.between(now, target);
    long hours = ChronoUnit.HOURS.between(now, target)-days*24;
    long minutes = ChronoUnit.MINUTES.between(now, target)-days*24*60-hours*60;
    long seconds = ChronoUnit.SECONDS.between(now, target)-days*24*60*60-hours*60*60-minutes*60;
    System.out.println("距离2026年2月17日0点0分0秒还有" + days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒");

}

}
